//
// Created by Vincent on 22-11-15.
//

#pragma once
#include "lpc/LidarFrame.pb.h"
#include <functional>
#include <memory>

namespace lidar
{
  class Lidar
  {
  public:
    virtual ~Lidar() = default;
    virtual void start(std::function<void(std::shared_ptr<lpc::LidarProtoPointCloud> &&)>) = 0;
    virtual void stop() = 0;

    class Builder
    {
    public:
      Builder &interface(const std::string &);
      Builder &id(int);
      Builder &ip(const std::string &);
      Builder &data_port(int);
      Builder &dev_port(int);
      Builder &type(const std::string &);
      Builder &model(const std::string &);
      std::unique_ptr<Lidar> build();

    private:
      int _id{-1};
      std::string  _interface{};
      std::string _ip{};
      int _data_port{-1};
      int _dev_port{-1};
      std::string _type{};
      std::string _model{};
    };
  };

} // namespace lidar
